(require 'auto-complete-config)

(ac-config-default)

(setq ac-use-menu-map t)
;; Default settings
(define-key ac-menu-map "\C-n" 'ac-next)
(define-key ac-menu-map "\C-p" 'ac-previous)

(ac-set-trigger-key "TAB")

(setq ac-auto-start nil)


(defun ac-settings-4-c ()
  (setq ac-sources
        '(ac-source-yasnippet
;;          ac-source-c-keywords
          ac-source-semantic-raw 
          ac-source-semantic
          ac-source-abbrev
;;          ac-source-words-in-buffer
;;          ac-source-words-in-all-buffer
;;          ac-source-files-in-current-dir
          ac-source-filename)
   )
)
(add-hook 'c-mode-hook 'ac-settings-4-c)

(defun ac-settings-4-cpp ()
  (setq ac-sources
        '(ac-source-yasnippet
;;          ac-source-c++-keywords
          ac-source-semantic-raw
          ac-source-semantic
          ac-source-abbrev
;;          ac-source-words-in-buffer
;;          ac-source-words-in-all-buffer
;;          ac-source-files-in-current-dir
          ac-source-filename)
  )
)
(add-hook 'c++-mode-hook 'ac-settings-4-cpp)


